Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding failing tests for end event firing multiple times when copying a file more than once. #402

Merged
merged 1 commit into from
Nov 13, 2013

Conversation

timrwood
Copy link
Contributor

Here is a failing test illustrating the issue in #302.

I think this is related to using the filename as part of the event name when added to the conflicter and resolving the conflict.

@timrwood
Copy link
Contributor Author

After more debugging, I think this is an issue with node's event emitter. I was able to whittle this down to a pretty small reproducible case.

var emitter = Object.create(require('events').EventEmitter.prototype);

emitter.once('e', function () {
    emitter.emit('e');
    console.log('Should be called once (emit)');
});

emitter.once('e', function () {
    console.log('Should be called once.');
});

emitter.emit('e');

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 86385e4fa71b0d04fabaea4a3e13080be5bc6588 on timrwood:single-end into c57e4e1 on yeoman:master.

@timrwood
Copy link
Contributor Author

I filed an issue with node (nodejs/node-v0.x-archive#6503) regarding the event emitter bug, but in the meantime, 86385e4 should work as a stopgap until that fix gets resolved in node.

@@ -501,6 +501,38 @@ describe('Environment', function () {
// actual run
.run('angular:all myapp');
});

it('should only call the end event once', function (done) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a note about the current bug so anyone looking at this test case know where it come from. Maybe just in the doc string adding (bug #402)

Also, remove the "should" from the doc string.

@SBoudrias
Copy link
Member

LGTM, thanks for digging this bug.

Can you checkout the comments I left and squash these two commits together?

@timrwood
Copy link
Contributor Author

Addressed your comments and rebased the commits.

SBoudrias added a commit that referenced this pull request Nov 13, 2013
Adding failing tests for end event firing multiple times when copying a file more than once.
@SBoudrias SBoudrias merged commit e003fba into yeoman:master Nov 13, 2013
@SBoudrias
Copy link
Member

Awesome thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants